import { AstContext } from "../../../context";
import { PageVisitor } from "../pageVisitor";

export function parseObject(visitor: PageVisitor, ast: AutoJs.UiObject, ctx: AstContext, key: string) {
    const c = ctx.create()
    ctx.eachChild(ast, node => {
        visitor.visit(node, c)
    })
    const obj = c.all()
    if (obj && Object.keys(obj).length > 0) {
        ctx.set(key, c.all())
    }
}